package com.goktech.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;


/**
 * 
 * @author yangbo
 * @date 2017-07-29
 */
@Controller
@RequestMapping("login")
public class LoginController {
	
	/**
	 * @return
	 */
	@RequestMapping("")
	public ModelAndView login() {
		return new ModelAndView("login");
	}
	
	/**
	 * @param username
	 * @param pwd
	 * @return
	 */
	@RequestMapping(value = {"/doLogin"},method= {RequestMethod.POST})
	@ResponseBody			
	public String login(@RequestParam String username,@RequestParam String pwd) {
		System.out.println("username= " + username + ",pwd= " + pwd);
		return "{\"code\":1,\"number\":0}";	
	}
}
